package com.probiz.estore.other.dao.impl;

import java.util.List;

import org.hibernate.FlushMode;

import com.probiz.estore.common.model.other.Tag;
import com.probiz.estore.core.dao.impl.HibernateGenericDaoImpl;
import com.probiz.estore.other.dao.TagDao;

/**
 * Dao implementation for Tag.
*/
public class TagDaoImpl extends HibernateGenericDaoImpl<Tag> implements TagDao {
	/*
	 * (non-Javadoc)
	 * @see com.probiz.estore.other.dao.TagDao#getTagByModuleByName(java.lang.Short, java.lang.String)
	 */
	public Tag getTagByModuleByName(Short module,String name){
		List<Tag> tagList = this.findByHql("from Tag where module = ? and tagName = ?", module,name);
		if(tagList.size() > 0){
			return tagList.get(0);
		}else{
			return null;
		}
	}
}
